]> dgit.raspbian.org Git - ostree.git/commit
static-delta: Validate decompressed size against declared usize
authorJoseph Marrero Corchado <jmarrero@redhat.com>
Wed, 29 Jul 2026 00:19:42 +0000 (20:19 -0400)
committerJoseph Marrero Corchado <jmarrero@redhat.com>
Wed, 29 Jul 2026 00:19:42 +0000 (20:19 -0400)
commita0ede4d33e0a0eb56052ef0a6ac5d8277da0057c
tree16ef3b4d8b80a6ce670ca5c6900253162dcbeb7b
parent18ed64bb0b5af15b38104ea491a7233eecc9a261
static-delta: Validate decompressed size against declared usize

Each delta part header already declares the expected uncompressed
size of the resulting objects.  Pass that through to
_ostree_static_delta_part_open() and use it as the decompression
limit when it is smaller than the hard cap.  This catches a
crafted delta that declares a small usize (passing the free-space
pre-check) but actually decompresses to something much larger.

The hard cap (512 MiB) remains as a backstop when the declared
size is unavailable (e.g. the show/dump path passes 0).

Suggested-by: Colin Walters <walters@verbum.org>
src/libostree/ostree-repo-pull.c
src/libostree/ostree-repo-static-delta-core.c
src/libostree/ostree-repo-static-delta-private.h